package state.util.array;

public class ByteArray {
  public byte[] array = null;
  private int size = 0;
  
  public static ByteArray create(int len) {
    byte[] value1 = new byte[len];
    return new ByteArray(value1, len);
  }
  
  public static void arraycopy(ByteArray src, int srcPos, ByteArray dest, int destPos, int length1) {
    System.arraycopy(src.array, srcPos, dest.array, destPos, length1);
  }
  
  public ByteArray(byte[] value1, int length1) {
    array = value1;
    size = length1;
  }
  
  public int len() {
    return size;
  }
  
  public byte get(int i) {
    return array[i];
  }
  
  public ByteArray set(int i, byte byte1) {
    array[i] = byte1;
    return this;
  }
  
  public void setArray(byte[] value1, int length1) {
    array = value1;
    size = length1;
  }
}
